<?php

/**
 * InputAgromet form base class.
 *
 * @method InputAgromet getObject() Returns the current form's model object
 *
 * @package    TMD
 * @subpackage form
 * @author     Thaihosting
 */
abstract class BaseInputAgrometForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'IAGROMET_ID'   => new sfWidgetFormInputHidden(),
      'DTTIME_ISSUE'  => new sfWidgetFormDateTime(),
      'STITLE'        => new sfWidgetFormInputText(),
      'STITLE_ENG'    => new sfWidgetFormInputText(),
      'IUSER_ID'      => new sfWidgetFormInputText(),
      'DTSAVE_TIME'   => new sfWidgetFormDateTime(),
      'IAGROMET_TYPE' => new sfWidgetFormInputText(),
      'SDOC_LINK'     => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'IAGROMET_ID'   => new sfValidatorChoice(array('choices' => array($this->getObject()->getIagrometId()), 'empty_value' => $this->getObject()->getIagrometId(), 'required' => false)),
      'DTTIME_ISSUE'  => new sfValidatorDateTime(array('required' => false)),
      'STITLE'        => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'STITLE_ENG'    => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'IUSER_ID'      => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'DTSAVE_TIME'   => new sfValidatorDateTime(array('required' => false)),
      'IAGROMET_TYPE' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'SDOC_LINK'     => new sfValidatorString(array('max_length' => 200, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('input_agromet[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'InputAgromet';
  }


}
